package de.tum.in.eist.poll.shared.beans;

import java.util.Map;
import java.util.TreeMap;

public class Answers {
	Map<Integer,Answer> answers;
	
	public Answers() {
		answers = new TreeMap<Integer,Answer>();
	}
	
	public Answers(TreeMap<Integer,Answer> answers) {
		this.answers = answers;
	}
	
	/**
	 * @return The {@link Answer} at the i-th position, i=1,2,... or
	 * 		   null if no Answer is available
	 */
	public Answer get(Integer index) {
		return answers.get(index);
	}
	
	/**
	 * Set an answer at an index i, i = 1,2,...
	 * 
	 * @param index  index of that Answer
	 * @param answer answer to be inserted
	 */
	public void set(Integer index, Answer answer) {
		answers.put(index, answer);
	}
}
